package nuc.edu.employmentservices.service;

import nuc.edu.employmentservices.dao.GraduatesMapper;
import nuc.edu.employmentservices.enity.Company;
import nuc.edu.employmentservices.enity.Graduates;
import nuc.edu.employmentservices.enity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

@Controller
public class GraduatesService {
    @Autowired
    private GraduatesMapper graduatesMapper;
    public List<Graduates> getAllGraduates()
    {
        List<Graduates> graduates=graduatesMapper.getAllGraduates();
        return graduates;
    }

    public Graduates getGraduatesById(Integer graID)
    {
        Graduates graduates=graduatesMapper.getGraduatesById(graID);
        System.out.println(graduates);
        return  graduates;
    }

    public Graduates getGraduatesByClassId(Integer graClassId){
        Graduates graduates=graduatesMapper.getGraduatesByClassId(graClassId);
        return  graduates;
    }

    public  void insertGraduates(Graduates graduates) throws ParseException {

        graduatesMapper.insertGraduates(graduates);
    }

    public  void deleteGraduates(Integer graID){

        graduatesMapper.deleteGraduates(graID);
    }

    public  void updateGraduatesById(Graduates graduates){

        graduatesMapper.updateGraduatesById(graduates);
    }

    public Integer Getgranum()
    {
        return graduatesMapper.Getgranum();

    }

    public List<Graduates> getGraduatesByClass(Integer graClassId){
        return graduatesMapper.getGraduatesByClass(graClassId);
    }

    public List<Graduates> getGraduatesByCompany(Integer comId){
        return graduatesMapper.getGraduatesByCompany(comId);
    }

    public  List<Graduates> getGraduatesByDirection(Integer dirId)
    {
        return graduatesMapper.getGraduatesByDirection(dirId);
    }
}
